package com.lzq.controller;

import com.lzq.pojo.User;
import com.lzq.service.UserService;
import com.springmvc.annotation.Autowired;
import com.springmvc.annotation.Controller;
import com.springmvc.annotation.RequestMapping;
import com.springmvc.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.util.List;
@Controller
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("/user/query")
    public void findUsers(HttpServletRequest req, HttpServletResponse resp,@RequestParam("name") String name){
        resp.setContentType("text/html;charset=utf-8");
        try{
            List<User> users = userService.findUsers(name);
            PrintWriter out = resp.getWriter();
            out.println("<h1>props is :"+name+"</h1>");
        }catch (Exception e){

        }
    }
}
